<?php declare(strict_types=1);


namespace App\Model\Entity;

use Swoft\Db\Annotation\Mapping\Column;
use Swoft\Db\Annotation\Mapping\Entity;
use Swoft\Db\Annotation\Mapping\Id;
use Swoft\Db\Eloquent\Model;


/**
 * post和challenge关联表
 * Class PostChallenge
 *
 * @since 2.0
 *
 * @Entity(table="post_challenge", pool="db2.pool")
 */
class PostChallenge extends Model
{
    /**
     * 
     * @Id()
     * @Column()
     *
     * @var int
     */
    private $id;

    /**
     * 挑战主题ID
     *
     * @Column(name="challenge_id", prop="challengeId")
     *
     * @var int
     */
    private $challengeId;

    /**
     * post id
     *
     * @Column(name="post_id", prop="postId")
     *
     * @var int
     */
    private $postId;

    /**
     * 创建时间
     *
     * @Column(name="created_at", prop="createdAt")
     *
     * @var int
     */
    private $createdAt;

    /**
     * post点赞和评论计数
     *
     * @Column()
     *
     * @var int
     */
    private $cnt;


    /**
     * @param int $id
     *
     * @return void
     */
    public function setId(int $id): void
    {
        $this->id = $id;
    }

    /**
     * @param int $challengeId
     *
     * @return void
     */
    public function setChallengeId(int $challengeId): void
    {
        $this->challengeId = $challengeId;
    }

    /**
     * @param int $postId
     *
     * @return void
     */
    public function setPostId(int $postId): void
    {
        $this->postId = $postId;
    }

    /**
     * @param int $createdAt
     *
     * @return void
     */
    public function setCreatedAt(int $createdAt): void
    {
        $this->createdAt = $createdAt;
    }

    /**
     * @param int $cnt
     *
     * @return void
     */
    public function setCnt(int $cnt): void
    {
        $this->cnt = $cnt;
    }

    /**
     * @return int
     */
    public function getId(): ?int
    {
        return $this->id;
    }

    /**
     * @return int
     */
    public function getChallengeId(): ?int
    {
        return $this->challengeId;
    }

    /**
     * @return int
     */
    public function getPostId(): ?int
    {
        return $this->postId;
    }

    /**
     * @return int
     */
    public function getCreatedAt(): ?int
    {
        return $this->createdAt;
    }

    /**
     * @return int
     */
    public function getCnt(): ?int
    {
        return $this->cnt;
    }

}
